home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / piselection.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-24  |  4.6 KB  |  133 lines

  1. /*
  2.     File: PISelection.h
  3.  
  4.     Copyright (c) 1996, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     This file describes version 1.0 of Photoshop's selection plug-in module
  8.     interface.
  9. */
  10.  
  11. #ifndef __PISelection__
  12. #define __PISelection__
  13.  
  14. #include "PIActions.h"
  15. #include "PIGeneral.h"
  16.  
  17. /********************************************************************************/
  18.  
  19. /* Operation selectors */
  20.  
  21. #define selectionSelectorAbout      0
  22. #define selectionSelectorExecute 1
  23.  
  24. /********************************************************************************/
  25.  
  26. /* Error return values. The plug-in module may also return standard Macintosh
  27.    operating system error codes, or report its own errors, in which case it
  28.    can return any positive integer. */
  29.    
  30. #define selectionBadParameters -30700    /* "a problem with the selection module interface" */
  31. #define selectionBadMode       -30701    /* "the selection module does not support <mode> images" */
  32.  
  33. /********************************************************************************/
  34.  
  35. typedef struct PISelectionParams
  36.     {
  37.     
  38.     /* We start with the fields that are common to pretty much all of the plug-ins. */
  39.     
  40.     int32        serialNumber;        /* Host's serial number, to allow
  41.                                        copy protected plug-in modules. */
  42.  
  43.     TestAbortProc    abortProc;        /* The plug-in module may call this no-argument
  44.                                        BOOLEAN function (using Pascal calling
  45.                                        conventions) several times a second during long
  46.                                        operations to allow the user to abort the operation.
  47.                                        If it returns TRUE, the operation should be aborted
  48.                                        (and a positive error code returned). */
  49.  
  50.     ProgressProc    progressProc;    /* The plug-in module may call this two-argument
  51.                                        procedure periodically to update a progress
  52.                                        indicator.  The first parameter is the number
  53.                                        of operations completed; the second is the total
  54.                                        number of operations. */
  55.  
  56.     OSType        hostSig;            /* Creator code for host application */
  57.     HostProc    hostProc;            /* Host specific callback procedure */
  58.  
  59.     BufferProcs *bufferProcs;        /* The host buffer procedures. */
  60.     
  61.     ResourceProcs *resourceProcs;    /* The host plug-in resource procedures. */
  62.     
  63.     ProcessEventProc processEvent;    /* Pass event to the application. */
  64.     
  65.     DisplayPixelsProc displayPixels;/* Display dithered pixels. */
  66.  
  67.     HandleProcs    *handleProcs;        /* Platform independent handle manipulation. */
  68.  
  69.     ColorServicesProc colorServices; /* Routine to access color services. */
  70.     
  71.     ImageServicesProcs *imageServicesProcs;
  72.                                     /* Suite of image processing callbacks. */
  73.             
  74.     PropertyProcs    *propertyProcs;    /*    Routines to query and set document and
  75.                                         view properties. The plug-in needs to
  76.                                         dispose of the handle returned for
  77.                                         complex properties (the plug-in also
  78.                                         maintains ownership of handles for
  79.                                         set properties.
  80.                                     */
  81.                                     
  82.     ChannelPortProcs *channelPortProcs;
  83.                                     /* Suite for passing pixels through channel ports. */
  84.             
  85.     PIDescriptorParameters    *descriptorParameters;    /* For recording and playback */
  86.     Str255                    *errorString;            /* For silent and errReportString */
  87.     
  88.     PlugInMonitor    monitor;        /* Information on current monitor */
  89.  
  90.     void         *platformData;        /* Platform specific information. */
  91.  
  92.     char reserved [4];                /* 4 bytes of reserved space. */
  93.     
  94.     /* We follow this with the fields specific to this type of plug-in. */
  95.     
  96.     ReadImageDocumentDesc *documentInfo;    /* The document for the selection. */
  97.     
  98.     WriteChannelDesc *newSelection;            /* A place to write the new selection. */
  99.     
  100.     Handle newPath;                            /* The plug-in can return a path instead of
  101.                                             a selection. If the plug-in makes this handle
  102.                                             non-null, any data written into the new
  103.                                             selection will be ignored and the path described
  104.                                             by the handle becomes the work path. The
  105.                                             handle will be disposed of by the host. */
  106.                                             
  107.     /* We can optionally take the mask and use it to build a new layer or floating
  108.     selection filled with the current foreground color. 
  109.      0 = make selection
  110.      1 = make path
  111.      2 = make layer/float */
  112.     
  113.     int32 treatment;
  114.     
  115.     int32 supportedTreatments; /* Mask indicating host supported treatments. */
  116.                                             
  117.     /* And, of course, space for future expansion. */
  118.     
  119.     char reservedBlock [256];
  120.             
  121.     }
  122. PISelectionParams, *SelectionRecordPtr;
  123.  
  124. /********************************************************************************/
  125.  
  126. #define piSelMakeMask            0
  127. #define piSelMakeWorkPath        1
  128. #define piSelMakeLayer            2
  129.  
  130. /********************************************************************************/
  131.  
  132. #endif /* __PISelection__ */
  133.